import { http } from './service.js'

export const getLiveList = (params) => {
	return http.request({
		url: '/api/yz/live/list',
		method: 'GET',
		params: params
	});
}

export const getLivePlayUrl = (alias) => {
	return http.request({
		url: '/api/yz/live/playurl',
		method: 'GET',
		params: {
			'alias': alias
		}
	});
}
// 线下课程列表
export const getOtCourseList = (params) => {
	return http.request({
		url: '/api/otcourse/list',
		method: 'GET',
		params: params
	});
}
// 线下课程详情
export const getOtCourse = (id) => {
	return http.request({
		url: '/api/otcourse',
		method: 'GET',
		params: {
			id: id,
		}
	});
}
// 预约
export const bookingRecord = (offlineCourseId) => {
	return http.request({
		url: '/api/otcourse/booking_record',
		method: 'POST',
		params: {
			'offlineCourseId': offlineCourseId,
			'booked': true,
		}
	});
}
// 预约签到列表
export const getBookingRecord = (offlineCourseId) => {
	return http.request({
		url: '/api/otcourse/booking_record/list',
		method: 'GET',
		params: {
			'offlineCourseId': offlineCourseId,
			'pageNum': 0,
			'pageSize': 999,
		}
	});
}
// 签到
export const checkRecord = (params) => {
	return http.request({
		url: '/api/otcourse/booking_record',
		method: 'POST',
		params: params
	});
}

// 录播课程分类
export const getCourseGroups = () => {
	return http.request({
		url: 'api/yz/course/course_groups',
		method: 'GET',
	});
}
// 录播课程列表
export const getCourseList = (groupId) => {
	return http.request({
		url: 'api/yz/course/list',
		method: 'GET',
		params: {
			groupId: groupId,
		}
	});
}